package xj.graph2d.graph;

import java.awt.geom.Dimension2D;

public class Dimension2DFloat extends Dimension2D {

  public Dimension2DFloat() {
  }

  public Dimension2DFloat(float width, float height) {
    this.width = width;
    this.height = height;
  }

  @Override
  public double getHeight() {
    return height;
  }

  @Override
  public double getWidth() {
    return width;
  }

  @Override
  public void setSize(Dimension2D d) {
    if (d != null) {
      width = (float) d.getWidth();
      height = (float) d.getHeight();
    }
  }

  @Override
  public void setSize(double width, double height) {
    this.width = (float) width;
    this.height = (float) height;
  }

  @Override
  public String toString() {
    return "[" + width + "x" + height + "]";
  }

  protected float width, height;

}
